<template>
	<view>
		<view class="" v-for="(item,index) in datalist" style="width: 85%;margin: 0px auto;border-radius: 20rpx;padding:20rpx;margin-top: 30rpx;box-shadow: 5rpx 5rpx 10rpx 10rpx rgba(0, 0, 0, 0.1);">
			<view class="ccc">
				<view class="">
					{{item.username}}({{item.usertel}})
				</view>
				<view class="">
					{{item.status == 1 ? '未支付' : item.status == 2 ? '检测中' : item.status == 3 ? '已完成' : '已取消'}}
				</view>
			</view>
			
			<view class="ccc" style="font-size: 28rpx;color: #a1a1a1;margin-top: 10rpx">
				<view class="">
					单号: <text style="font-size: 24rpx;">{{item.order_id}}</text>
				</view>
				<view class="" style="font-size: 24rpx;">
					{{item.createtime}}
				</view>
			</view>
			<view class="xian" style="border-bottom: 1px solid #eaeaea;margin: 15rpx 0rpx 15rpx 0rpx;"></view>
			<view class="ccc" v-for="(it,id) in item.items" style="font-size: 28rpx;">
				<view class="">
					{{id + 1}}、{{it.name}}
				</view>
				<view class="">
					￥{{it.price}}
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				id:'',
				datalist:[]
			}
		},
		onLoad(options) {
			this.id = options.id
			this.getdata()
		},
		methods: {
			getdata(){
				var that = this
				uni.showLoading({
					title: '加载中...'
				})
				uni.request({
					url: this.global.url + 'api/device/patient_detail',
					method: 'POST',
					data: {
						id:that.id,
					},
					success(res) {
						let result = res.data
						console.log(result)
						if (result.code == 1) {
							// 存用户信息
							that.datalist = result.data				
						} else {
							uni.showToast({
								title: result.msg,
								icon: 'none'
							})
						}
					},
					complete() {
						uni.hideLoading()
					}
				})
			}
		}
	}
</script>

<style>
.ccc{
	display: flex;
	justify-content: space-between;
	margin-top:10rpx;
}
</style>
